Skip to content

Update ls command to recurse all objects if -r flag is provided with no bucket#57

Merged
overtrue merged 3 commits intorustfs:mainfrom
Simon9870:47-ls-recurse-buckets
Mar 20, 2026
Merged

Update ls command to recurse all objects if -r flag is provided with no bucket#57
overtrue merged 3 commits intorustfs:mainfrom
Simon9870:47-ls-recurse-buckets

Conversation

@Simon9870
Copy link
Contributor

This brings rc more in line with mc's behaviour, specifically when using the recursive flag. No other behaviour changes other than if you provide the -r flag with an alias but no bucket specified. Previously this would have listed just the buckets (same as without the flag), now it lists all objects on the server.

Closes #47

…no bucket

This brings rc more in line with mc's behaviour, specifically when using the recursive flag. No other behaviour changes other than if you provide the -r flag with an alias but no bucket specified. Previously this would have listed just the buckets (same as without the flag), now it lists all objects on the server.
@overtrue
Copy link
Contributor

@codex review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the CLI ls command to match mc behavior by recursing through all buckets when -r/--recursive is provided with an alias but no bucket, and refactors object listing pagination into a shared helper.

Changes:

  • Add ls -r <alias> behavior to list objects across all buckets instead of listing buckets only.
  • Introduce list_all_objects to enumerate buckets then recursively list objects per bucket.
  • Extract pagination logic into list_objects_with_paging to reuse in both single-bucket and all-buckets listing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cc46fa7b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Simon9870 and others added 2 commits March 20, 2026 09:53
Iterating over HashMap in the text output path (for (bucket_name, objects) in all_items) produces a non-deterministic bucket order between runs, which can make CLI output harder to read and test. If you keep the bucket grouping, consider using an order-preserving structure (e.g., Vec in list_buckets() order, or BTreeMap) so output is stable.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Simon <266044650+Simon9870@users.noreply.github.com>
@Simon9870
Copy link
Contributor Author

@overtrue I have addressed all comments

@overtrue overtrue merged commit 21adb36 into rustfs:main Mar 20, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rc recursive ls should list contents of all buckets if requested

3 participants